import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            redirect: '/Home'
        },
        {
            path: '/Home',
            name: 'home',
            component: HomeView,
            children: [
                {
                    path: '', // 链接如果是/Home就默认显示BottomView
                    name:'hson',// 要起个和home不一样的名字
                    component: () => import('../views/BottomView.vue')
                },
                {
                    path: 'Bottom', // 不用以`/`开头
                    name: 'bottom',
                    component: () => import('../views/BottomView.vue')
                },
                {
                    path: 'Ad',
                    name: 'ad',
                    component: () => import('../views/AdView.vue')
                }
            ]
        },
        {
            path: '/About',
            name: 'about',
            component: () => import('../views/AboutView.vue')
        }
    ]
});

export default router